/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('paifeaturestore', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model FeatureViewConfigValue = {
  partitions?: map[string]FeatureViewConfigValuePartitionsValue(name='Partitions'),
  eventTime?: string(name='EventTime'),
  equal?: boolean(name='Equal'),
  useMock?: boolean(name='UseMock'),
}

model FeatureViewConfigValuePartitionsValue = {
  value?: string(name='Value'),
  values?: [ string ](name='Values'),
  startValue?: string(name='StartValue'),
  endValue?: string(name='EndValue'),
}

model CheckInstanceDatasourceRequest {
  config?: string(name='Config', example='{"address": ""}'),
  type?: string(name='Type', description='This parameter is required.', example='Hologres'),
  uri?: string(name='Uri', description='This parameter is required.', example='igraph1'),
}

model CheckInstanceDatasourceResponseBody = {
  requestId?: string(name='RequestId', example='C03B2680-AC9C-59CD-93C5-8142B92537FA'),
  status?: string(name='Status', example='Success'),
}

model CheckInstanceDatasourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckInstanceDatasourceResponseBody(name='body'),
}

/**
 * @summary 检测资源连接状态。
 *
 * @param request CheckInstanceDatasourceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckInstanceDatasourceResponse
 */
async function checkInstanceDatasourceWithOptions(InstanceId: string, request: CheckInstanceDatasourceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CheckInstanceDatasourceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.config)) {
    body['Config'] = request.config;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  if (!Util.isUnset(request.uri)) {
    body['Uri'] = request.uri;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CheckInstanceDatasource',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/action/checkdatasource`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 检测资源连接状态。
 *
 * @param request CheckInstanceDatasourceRequest
 * @return CheckInstanceDatasourceResponse
 */
async function checkInstanceDatasource(InstanceId: string, request: CheckInstanceDatasourceRequest): CheckInstanceDatasourceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return checkInstanceDatasourceWithOptions(InstanceId, request, headers, runtime);
}

model CreateDatasourceRequest {
  config?: string(name='Config', example='{"address": ""}'),
  name?: string(name='Name', description='This parameter is required.', example='datasource1'),
  type?: string(name='Type', description='This parameter is required.', example='Hologres'),
  uri?: string(name='Uri', description='This parameter is required.', example='igraph_instance1'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='234'),
}

model CreateDatasourceResponseBody = {
  datasourceId?: string(name='DatasourceId', example='3'),
  requestId?: string(name='RequestId', example='1C5B1511-8A5B-59C3-90AF-513F9210E882'),
}

model CreateDatasourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDatasourceResponseBody(name='body'),
}

/**
 * @summary 创建数据源。
 *
 * @param request CreateDatasourceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDatasourceResponse
 */
async function createDatasourceWithOptions(InstanceId: string, request: CreateDatasourceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateDatasourceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.config)) {
    body['Config'] = request.config;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  if (!Util.isUnset(request.uri)) {
    body['Uri'] = request.uri;
  }
  if (!Util.isUnset(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateDatasource',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/datasources`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建数据源。
 *
 * @param request CreateDatasourceRequest
 * @return CreateDatasourceResponse
 */
async function createDatasource(InstanceId: string, request: CreateDatasourceRequest): CreateDatasourceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createDatasourceWithOptions(InstanceId, request, headers, runtime);
}

model CreateFeatureEntityRequest {
  joinId?: string(name='JoinId', description='This parameter is required.', example='user_id'),
  name?: string(name='Name', description='This parameter is required.', example='feature_entity_1'),
  projectId?: string(name='ProjectId', description='This parameter is required.', example='3'),
}

model CreateFeatureEntityResponseBody = {
  featureEntityId?: string(name='FeatureEntityId', example='3'),
  requestId?: string(name='RequestId', example='0C89F5E1-7F24-5EEC-9F05-508A39278CC8'),
}

model CreateFeatureEntityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateFeatureEntityResponseBody(name='body'),
}

/**
 * @summary 创建特征实体
 *
 * @param request CreateFeatureEntityRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateFeatureEntityResponse
 */
async function createFeatureEntityWithOptions(InstanceId: string, request: CreateFeatureEntityRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateFeatureEntityResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.joinId)) {
    body['JoinId'] = request.joinId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.projectId)) {
    body['ProjectId'] = request.projectId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateFeatureEntity',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/featureentities`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建特征实体
 *
 * @param request CreateFeatureEntityRequest
 * @return CreateFeatureEntityResponse
 */
async function createFeatureEntity(InstanceId: string, request: CreateFeatureEntityRequest): CreateFeatureEntityResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createFeatureEntityWithOptions(InstanceId, request, headers, runtime);
}

model CreateFeatureViewRequest {
  config?: string(name='Config', example='{"save_original_field":true}'),
  featureEntityId?: string(name='FeatureEntityId', example='4'),
  fields?: [ 
    {
      attributes?: [ string ](name='Attributes'),
      name?: string(name='Name', example='age'),
      type?: string(name='Type', example='INT32'),
    }
  ](name='Fields'),
  name?: string(name='Name', description='This parameter is required.', example='FeatureView1'),
  projectId?: string(name='ProjectId', description='This parameter is required.', example='3'),
  registerDatasourceId?: string(name='RegisterDatasourceId', example='5'),
  registerTable?: string(name='RegisterTable', example='table1'),
  syncOnlineTable?: boolean(name='SyncOnlineTable', description='This parameter is required.', example='true'),
  TTL?: int32(name='TTL', example='90'),
  tags?: [ string ](name='Tags'),
  type?: string(name='Type', description='This parameter is required.', example='Batch'),
  writeMethod?: string(name='WriteMethod', description='This parameter is required.', example='Custom'),
  writeToFeatureDB?: boolean(name='WriteToFeatureDB'),
}

model CreateFeatureViewResponseBody = {
  featureViewId?: string(name='FeatureViewId', example='3'),
  requestId?: string(name='RequestId', example='0C89F5E1-7F24-5EEC-9F05-508A39278CC8'),
}

model CreateFeatureViewResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateFeatureViewResponseBody(name='body'),
}

/**
 * @summary 创建特征视图。
 *
 * @param request CreateFeatureViewRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateFeatureViewResponse
 */
async function createFeatureViewWithOptions(InstanceId: string, request: CreateFeatureViewRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateFeatureViewResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.config)) {
    body['Config'] = request.config;
  }
  if (!Util.isUnset(request.featureEntityId)) {
    body['FeatureEntityId'] = request.featureEntityId;
  }
  if (!Util.isUnset(request.fields)) {
    body['Fields'] = request.fields;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.projectId)) {
    body['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.registerDatasourceId)) {
    body['RegisterDatasourceId'] = request.registerDatasourceId;
  }
  if (!Util.isUnset(request.registerTable)) {
    body['RegisterTable'] = request.registerTable;
  }
  if (!Util.isUnset(request.syncOnlineTable)) {
    body['SyncOnlineTable'] = request.syncOnlineTable;
  }
  if (!Util.isUnset(request.TTL)) {
    body['TTL'] = request.TTL;
  }
  if (!Util.isUnset(request.tags)) {
    body['Tags'] = request.tags;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  if (!Util.isUnset(request.writeMethod)) {
    body['WriteMethod'] = request.writeMethod;
  }
  if (!Util.isUnset(request.writeToFeatureDB)) {
    body['WriteToFeatureDB'] = request.writeToFeatureDB;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateFeatureView',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/featureviews`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建特征视图。
 *
 * @param request CreateFeatureViewRequest
 * @return CreateFeatureViewResponse
 */
async function createFeatureView(InstanceId: string, request: CreateFeatureViewRequest): CreateFeatureViewResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createFeatureViewWithOptions(InstanceId, request, headers, runtime);
}

model CreateInstanceRequest {
  type?: string(name='Type', example='Basic'),
}

model CreateInstanceResponseBody = {
  code?: string(name='Code', example='InstanceAlreadyExistsErrorProblem'),
  instanceId?: string(name='InstanceId', example='featureStore-cn-7mz2xfu****'),
  requestId?: string(name='RequestId', example='C33E160C-BFCA-5719-B958-942850E949F6'),
}

model CreateInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateInstanceResponseBody(name='body'),
}

/**
 * @summary 创建Feature Store实例。
 *
 * @param request CreateInstanceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateInstanceResponse
 */
async function createInstanceWithOptions(request: CreateInstanceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateInstanceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateInstance',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建Feature Store实例。
 *
 * @param request CreateInstanceRequest
 * @return CreateInstanceResponse
 */
async function createInstance(request: CreateInstanceRequest): CreateInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createInstanceWithOptions(request, headers, runtime);
}

model CreateLabelTableRequest {
  datasourceId?: string(name='DatasourceId', description='This parameter is required.', example='3'),
  fields?: [ 
    {
      attributes?: [ string ](name='Attributes', description='This parameter is required.'),
      name?: string(name='Name', description='This parameter is required.', example='lat'),
      type?: string(name='Type', description='This parameter is required.', example='INT32'),
    }
  ](name='Fields', description='This parameter is required.'),
  name?: string(name='Name', description='This parameter is required.', example='rec_test'),
  projectId?: string(name='ProjectId', description='This parameter is required.', example='3'),
}

model CreateLabelTableResponseBody = {
  labelTableId?: string(name='LabelTableId', example='1'),
  requestId?: string(name='RequestId', example='0FA90B3B-F30A-5C9D-A9FD-8114F8868062'),
}

model CreateLabelTableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateLabelTableResponseBody(name='body'),
}

/**
 * @summary 创建label表
 *
 * @param request CreateLabelTableRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateLabelTableResponse
 */
async function createLabelTableWithOptions(InstanceId: string, request: CreateLabelTableRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateLabelTableResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.datasourceId)) {
    body['DatasourceId'] = request.datasourceId;
  }
  if (!Util.isUnset(request.fields)) {
    body['Fields'] = request.fields;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.projectId)) {
    body['ProjectId'] = request.projectId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateLabelTable',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/labeltables`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建label表
 *
 * @param request CreateLabelTableRequest
 * @return CreateLabelTableResponse
 */
async function createLabelTable(InstanceId: string, request: CreateLabelTableRequest): CreateLabelTableResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createLabelTableWithOptions(InstanceId, request, headers, runtime);
}

model CreateModelFeatureRequest {
  features?: [ 
    {
      aliasName?: string(name='AliasName', example='userid'),
      featureViewId?: string(name='FeatureViewId', description='This parameter is required.', example='5'),
      name?: string(name='Name', description='This parameter is required.', example='user_id'),
      type?: string(name='Type', description='This parameter is required.', example='STRING'),
    }
  ](name='Features', description='This parameter is required.'),
  labelPriorityLevel?: long(name='LabelPriorityLevel', example='0'),
  labelTableId?: string(name='LabelTableId', description='This parameter is required.', example='4'),
  name?: string(name='Name', description='This parameter is required.', example='model_feature_1'),
  projectId?: string(name='ProjectId', description='This parameter is required.', example='3'),
  sequenceFeatureViewIds?: [ string ](name='SequenceFeatureViewIds'),
}

model CreateModelFeatureResponseBody = {
  modelFeatureId?: string(name='ModelFeatureId', example='3'),
  requestId?: string(name='RequestId', example='37D19490-AB69-567D-A852-407C94E510E9'),
}

model CreateModelFeatureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateModelFeatureResponseBody(name='body'),
}

/**
 * @summary 创建模型特征。
 *
 * @param request CreateModelFeatureRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateModelFeatureResponse
 */
async function createModelFeatureWithOptions(InstanceId: string, request: CreateModelFeatureRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateModelFeatureResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.features)) {
    body['Features'] = request.features;
  }
  if (!Util.isUnset(request.labelPriorityLevel)) {
    body['LabelPriorityLevel'] = request.labelPriorityLevel;
  }
  if (!Util.isUnset(request.labelTableId)) {
    body['LabelTableId'] = request.labelTableId;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.projectId)) {
    body['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.sequenceFeatureViewIds)) {
    body['SequenceFeatureViewIds'] = request.sequenceFeatureViewIds;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateModelFeature',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/modelfeatures`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建模型特征。
 *
 * @param request CreateModelFeatureRequest
 * @return CreateModelFeatureResponse
 */
async function createModelFeature(InstanceId: string, request: CreateModelFeatureRequest): CreateModelFeatureResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createModelFeatureWithOptions(InstanceId, request, headers, runtime);
}

model CreateProjectRequest {
  description?: string(name='Description', example='This is a test.'),
  name?: string(name='Name', description='This parameter is required.', example='project1'),
  offlineDatasourceId?: string(name='OfflineDatasourceId', description='This parameter is required.', example='4'),
  offlineLifeCycle?: int32(name='OfflineLifeCycle', example='90'),
  onlineDatasourceId?: string(name='OnlineDatasourceId', description='This parameter is required.', example='3'),
  workspaceId?: string(name='WorkspaceId', description='This parameter is required.', example='324'),
}

model CreateProjectResponseBody = {
  projectId?: string(name='ProjectId', example='3'),
  requestId?: string(name='RequestId', example='977ADE3A-D69D-58AD-8323-96E2FB898E99'),
}

model CreateProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateProjectResponseBody(name='body'),
}

/**
 * @summary 创建FeatureStore项目
 *
 * @param request CreateProjectRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateProjectResponse
 */
async function createProjectWithOptions(InstanceId: string, request: CreateProjectRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateProjectResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.offlineDatasourceId)) {
    body['OfflineDatasourceId'] = request.offlineDatasourceId;
  }
  if (!Util.isUnset(request.offlineLifeCycle)) {
    body['OfflineLifeCycle'] = request.offlineLifeCycle;
  }
  if (!Util.isUnset(request.onlineDatasourceId)) {
    body['OnlineDatasourceId'] = request.onlineDatasourceId;
  }
  if (!Util.isUnset(request.workspaceId)) {
    body['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateProject',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/projects`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建FeatureStore项目
 *
 * @param request CreateProjectRequest
 * @return CreateProjectResponse
 */
async function createProject(InstanceId: string, request: CreateProjectRequest): CreateProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createProjectWithOptions(InstanceId, request, headers, runtime);
}

model CreateServiceIdentityRoleRequest {
  roleName?: string(name='RoleName', description='This parameter is required.', example='AliyunServiceRoleForFeatureStore'),
}

model CreateServiceIdentityRoleResponseBody = {
  code?: string(name='Code', example='ServiceLinkedRoleAlreadyExistsErrorProblem'),
  requestId?: string(name='RequestId', example='C03B2680-AC9C-59CD-93C5-8142B92537FA'),
  roleName?: string(name='RoleName', example='AliyunServiceRoleForFeatureStore'),
}

model CreateServiceIdentityRoleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateServiceIdentityRoleResponseBody(name='body'),
}

/**
 * @summary 创建feature store服务账户角色
 *
 * @param request CreateServiceIdentityRoleRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateServiceIdentityRoleResponse
 */
async function createServiceIdentityRoleWithOptions(request: CreateServiceIdentityRoleRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateServiceIdentityRoleResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.roleName)) {
    body['RoleName'] = request.roleName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateServiceIdentityRole',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/serviceidentityroles`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建feature store服务账户角色
 *
 * @param request CreateServiceIdentityRoleRequest
 * @return CreateServiceIdentityRoleResponse
 */
async function createServiceIdentityRole(request: CreateServiceIdentityRoleRequest): CreateServiceIdentityRoleResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return createServiceIdentityRoleWithOptions(request, headers, runtime);
}

model DeleteDatasourceResponseBody = {
  requestId?: string(name='RequestId', example='E2E1575F-29D1-5579-B649-B7883A793562'),
}

model DeleteDatasourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDatasourceResponseBody(name='body'),
}

/**
 * @summary 删除指定数据源。
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDatasourceResponse
 */
async function deleteDatasourceWithOptions(InstanceId: string, DatasourceId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteDatasourceResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteDatasource',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/datasources/${OpenApiUtil.getEncodeParam(DatasourceId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除指定数据源。
 *
 * @return DeleteDatasourceResponse
 */
async function deleteDatasource(InstanceId: string, DatasourceId: string): DeleteDatasourceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteDatasourceWithOptions(InstanceId, DatasourceId, headers, runtime);
}

model DeleteFeatureEntityResponseBody = {
  requestId?: string(name='RequestId', example='E23EFF09-58AA-5420-934F-8453AE01548D'),
}

model DeleteFeatureEntityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteFeatureEntityResponseBody(name='body'),
}

/**
 * @summary 删除指定特征实体
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteFeatureEntityResponse
 */
async function deleteFeatureEntityWithOptions(InstanceId: string, FeatureEntityId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteFeatureEntityResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteFeatureEntity',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/featureentities/${OpenApiUtil.getEncodeParam(FeatureEntityId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除指定特征实体
 *
 * @return DeleteFeatureEntityResponse
 */
async function deleteFeatureEntity(InstanceId: string, FeatureEntityId: string): DeleteFeatureEntityResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteFeatureEntityWithOptions(InstanceId, FeatureEntityId, headers, runtime);
}

model DeleteFeatureViewResponseBody = {
  requestId?: string(name='RequestId', example='BF349686-C932-55B5-9B31-DAFA395C0E06'),
}

model DeleteFeatureViewResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteFeatureViewResponseBody(name='body'),
}

/**
 * @summary 删除指定特征视图。
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteFeatureViewResponse
 */
async function deleteFeatureViewWithOptions(InstanceId: string, FeatureViewId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteFeatureViewResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteFeatureView',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/featureviews/${OpenApiUtil.getEncodeParam(FeatureViewId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除指定特征视图。
 *
 * @return DeleteFeatureViewResponse
 */
async function deleteFeatureView(InstanceId: string, FeatureViewId: string): DeleteFeatureViewResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteFeatureViewWithOptions(InstanceId, FeatureViewId, headers, runtime);
}

model DeleteLabelTableResponseBody = {
  requestId?: string(name='RequestId', example='FFD39C0F-DD8D-51B2-864E-2842206DB0E8'),
}

model DeleteLabelTableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteLabelTableResponseBody(name='body'),
}

/**
 * @summary 删除label表
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteLabelTableResponse
 */
async function deleteLabelTableWithOptions(InstanceId: string, LabelTableId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteLabelTableResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteLabelTable',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/labeltables/${OpenApiUtil.getEncodeParam(LabelTableId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除label表
 *
 * @return DeleteLabelTableResponse
 */
async function deleteLabelTable(InstanceId: string, LabelTableId: string): DeleteLabelTableResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteLabelTableWithOptions(InstanceId, LabelTableId, headers, runtime);
}

model DeleteModelFeatureResponseBody = {
  requestId?: string(name='RequestId', example='6B662A64-E4BF-56F8-BF5F-4C63F34EC0A8'),
}

model DeleteModelFeatureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteModelFeatureResponseBody(name='body'),
}

/**
 * @summary 删除指定模型特征。
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteModelFeatureResponse
 */
async function deleteModelFeatureWithOptions(InstanceId: string, ModelFeatureId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteModelFeatureResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteModelFeature',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/modelfeatures/${OpenApiUtil.getEncodeParam(ModelFeatureId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除指定模型特征。
 *
 * @return DeleteModelFeatureResponse
 */
async function deleteModelFeature(InstanceId: string, ModelFeatureId: string): DeleteModelFeatureResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteModelFeatureWithOptions(InstanceId, ModelFeatureId, headers, runtime);
}

model DeleteProjectResponseBody = {
  requestId?: string(name='RequestId', example='0DA35264-0877-5852-8971-7735B547C969'),
}

model DeleteProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteProjectResponseBody(name='body'),
}

/**
 * @summary 删除指定Feature Store项目。
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteProjectResponse
 */
async function deleteProjectWithOptions(InstanceId: string, ProjectId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProjectResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'DeleteProject',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/projects/${OpenApiUtil.getEncodeParam(ProjectId)}`,
    method = 'DELETE',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除指定Feature Store项目。
 *
 * @return DeleteProjectResponse
 */
async function deleteProject(InstanceId: string, ProjectId: string): DeleteProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return deleteProjectWithOptions(InstanceId, ProjectId, headers, runtime);
}

model ExportModelFeatureTrainingSetTableRequest {
  featureViewConfig?: map[string]FeatureViewConfigValue(name='FeatureViewConfig'),
  labelInputConfig?: {
    eventTime?: string(name='EventTime', example='2022-07-02 00:00:00'),
    partitions?: map[string]object(name='Partitions'),
  }(name='LabelInputConfig'),
  realTimeIterateInterval?: long(name='RealTimeIterateInterval'),
  realTimePartitionCountValue?: long(name='RealTimePartitionCountValue'),
  trainingSetConfig?: {
    partitions?: map[string]object(name='Partitions'),
  }(name='TrainingSetConfig'),
}

model ExportModelFeatureTrainingSetTableResponseBody = {
  requestId?: string(name='RequestId', example='0FBBE454-9BD1-5D8F-9129-D14DB7FAFE0B'),
  taskId?: string(name='TaskId'),
}

model ExportModelFeatureTrainingSetTableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ExportModelFeatureTrainingSetTableResponseBody(name='body'),
}

/**
 * @summary 导出训练集表。
 *
 * @param request ExportModelFeatureTrainingSetTableRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ExportModelFeatureTrainingSetTableResponse
 */
async function exportModelFeatureTrainingSetTableWithOptions(InstanceId: string, ModelFeatureId: string, request: ExportModelFeatureTrainingSetTableRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ExportModelFeatureTrainingSetTableResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.featureViewConfig)) {
    body['FeatureViewConfig'] = request.featureViewConfig;
  }
  if (!Util.isUnset(request.labelInputConfig)) {
    body['LabelInputConfig'] = request.labelInputConfig;
  }
  if (!Util.isUnset(request.realTimeIterateInterval)) {
    body['RealTimeIterateInterval'] = request.realTimeIterateInterval;
  }
  if (!Util.isUnset(request.realTimePartitionCountValue)) {
    body['RealTimePartitionCountValue'] = request.realTimePartitionCountValue;
  }
  if (!Util.isUnset(request.trainingSetConfig)) {
    body['TrainingSetConfig'] = request.trainingSetConfig;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ExportModelFeatureTrainingSetTable',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/modelfeatures/${OpenApiUtil.getEncodeParam(ModelFeatureId)}/action/exporttrainingsettable`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 导出训练集表。
 *
 * @param request ExportModelFeatureTrainingSetTableRequest
 * @return ExportModelFeatureTrainingSetTableResponse
 */
async function exportModelFeatureTrainingSetTable(InstanceId: string, ModelFeatureId: string, request: ExportModelFeatureTrainingSetTableRequest): ExportModelFeatureTrainingSetTableResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return exportModelFeatureTrainingSetTableWithOptions(InstanceId, ModelFeatureId, request, headers, runtime);
}

model GetDatasourceResponseBody = {
  config?: string(name='Config', example='{"address": ""}'),
  datasourceId?: string(name='DatasourceId', example='3'),
  gmtCreateTime?: string(name='GmtCreateTime', example='2023-07-04T11:26:09.036+08:00'),
  gmtModifiedTime?: string(name='GmtModifiedTime', example='2023-07-04T11:26:09.036+08:00'),
  name?: string(name='Name', example='datasource1'),
  requestId?: string(name='RequestId', example='AD7D9E95-BD31-53F2-B710-6C01866FCB05'),
  type?: string(name='Type', example='Hologres'),
  uri?: string(name='Uri', example='igraph_instance1'),
  workspaceId?: string(name='WorkspaceId', example='32244'),
}

model GetDatasourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDatasourceResponseBody(name='body'),
}

/**
 * @summary 获取数据源详细信息。
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDatasourceResponse
 */
async function getDatasourceWithOptions(InstanceId: string, DatasourceId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetDatasourceResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetDatasource',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/datasources/${OpenApiUtil.getEncodeParam(DatasourceId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取数据源详细信息。
 *
 * @return GetDatasourceResponse
 */
async function getDatasource(InstanceId: string, DatasourceId: string): GetDatasourceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getDatasourceWithOptions(InstanceId, DatasourceId, headers, runtime);
}

model GetDatasourceTableResponseBody = {
  fields?: [ 
    {
      attributes?: [ string ](name='Attributes'),
      name?: string(name='Name', example='field1'),
      type?: string(name='Type', example='INT32'),
    }
  ](name='Fields'),
  requestId?: string(name='RequestId', example='D7B2F8C4-49C7-5CFA-8075-9D715A114873'),
  tableName?: string(name='TableName', example='table1'),
}

model GetDatasourceTableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDatasourceTableResponseBody(name='body'),
}

/**
 * @summary 获取数据源下指定表的详细信息。
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDatasourceTableResponse
 */
async function getDatasourceTableWithOptions(InstanceId: string, DatasourceId: string, TableName: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetDatasourceTableResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetDatasourceTable',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/datasources/${OpenApiUtil.getEncodeParam(DatasourceId)}/tables/${OpenApiUtil.getEncodeParam(TableName)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取数据源下指定表的详细信息。
 *
 * @return GetDatasourceTableResponse
 */
async function getDatasourceTable(InstanceId: string, DatasourceId: string, TableName: string): GetDatasourceTableResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getDatasourceTableWithOptions(InstanceId, DatasourceId, TableName, headers, runtime);
}

model GetFeatureEntityResponseBody = {
  gmtCreateTime?: string(name='GmtCreateTime', example='2021-12-15T23:24:33.132+08:00'),
  joinId?: string(name='JoinId', example='user_id'),
  name?: string(name='Name', example='feature_entity_1'),
  owner?: string(name='Owner', example='123456789*****'),
  projectId?: string(name='ProjectId', example='3'),
  projectName?: string(name='ProjectName', example='project_1'),
  requestId?: string(name='RequestId', example='E23EFF09-58AA-5420-934F-8453AE01548D'),
}

model GetFeatureEntityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetFeatureEntityResponseBody(name='body'),
}

/**
 * @summary 获取特征实体详细信息
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetFeatureEntityResponse
 */
async function getFeatureEntityWithOptions(InstanceId: string, FeatureEntityId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetFeatureEntityResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetFeatureEntity',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/featureentities/${OpenApiUtil.getEncodeParam(FeatureEntityId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取特征实体详细信息
 *
 * @return GetFeatureEntityResponse
 */
async function getFeatureEntity(InstanceId: string, FeatureEntityId: string): GetFeatureEntityResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getFeatureEntityWithOptions(InstanceId, FeatureEntityId, headers, runtime);
}

model GetFeatureViewResponseBody = {
  config?: string(name='Config', example='{"save_original_field":true}'),
  featureEntityId?: string(name='FeatureEntityId', example='3'),
  featureEntityName?: string(name='FeatureEntityName', example='featureEntity1'),
  fields?: [ 
    {
      attributes?: [ string ](name='Attributes'),
      name?: string(name='Name', example='user'),
      type?: string(name='Type', example='int'),
    }
  ](name='Fields'),
  gmtCreateTime?: string(name='GmtCreateTime', example='2021-12-15T23:24:33.132+08:00'),
  gmtModifiedTime?: string(name='GmtModifiedTime', example='2021-12-15T23:24:33.132+08:00'),
  gmtSyncTime?: string(name='GmtSyncTime', example='2021-12-15T23:24:33.132+08:00'),
  joinId?: string(name='JoinId', example='user_id'),
  lastSyncConfig?: string(name='LastSyncConfig', example='{
	"mode": "overwrite",
	"partitions": {
		"ds": {
			"value": "20230820"
		}
	},
	"event_time": "",
	"config": {},
	"offline_to_online": true
}'),
  mockTableName?: string(name='MockTableName', example='item_table_mock_1'),
  name?: string(name='Name', example='featureView1'),
  owner?: string(name='Owner', example='12321421412****'),
  projectId?: string(name='ProjectId', example='3'),
  projectName?: string(name='ProjectName', example='project1'),
  publishTableScript?: string(name='PublishTableScript', example='from feature_store_py.fs_client import FeatureStoreClient\\nimport datetime\\nfrom feature_store_py.fs_datasource import MaxComputeDataSource\\nimport sys\\n\\ncur_day = args[\\"dt\\"]\\nprint(\\"cur_day = \\", cur_day)\\n\\naccess_key_id = o.account.access_id\\naccess_key_secret = o.account.secret_access_key\\nfs = FeatureStoreClient(access_key_id=access_key_id, access_key_secret=access_key_secret, region=\\"cn-beijing\\")\\ncur_project_name = \\"p1\\"\\nproject = fs.get_project(cur_project_name)\\n\\nfeature_view_name = \\"user_fea\\"\\nbatch_feature_view = project.get_feature_view(feature_view_name)\\ntask = batch_feature_view.publish_table(partitions={\\"ds\\":cur_day}, mode=\\"Overwrite\\")\\ntask.wait()\\ntask.print_summary()\\n'),
  registerDatasourceId?: string(name='RegisterDatasourceId', example='4'),
  registerDatasourceName?: string(name='RegisterDatasourceName', example='datasource1'),
  registerTable?: string(name='RegisterTable', example='table1'),
  requestId?: string(name='RequestId', example='72F15A8A-5A28-5B18-A0DE-0EABD7D3245A'),
  syncOnlineTable?: boolean(name='SyncOnlineTable', example='true'),
  TTL?: int32(name='TTL', example='90'),
  tags?: [ string ](name='Tags'),
  type?: string(name='Type', example='Batch'),
  writeMethod?: string(name='WriteMethod', example='custom'),
  writeToFeatureDB?: boolean(name='WriteToFeatureDB'),
}

model GetFeatureViewResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetFeatureViewResponseBody(name='body'),
}

/**
 * @summary 获取特征视图详细信息。
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetFeatureViewResponse
 */
async function getFeatureViewWithOptions(InstanceId: string, FeatureViewId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetFeatureViewResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetFeatureView',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/featureviews/${OpenApiUtil.getEncodeParam(FeatureViewId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取特征视图详细信息。
 *
 * @return GetFeatureViewResponse
 */
async function getFeatureView(InstanceId: string, FeatureViewId: string): GetFeatureViewResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getFeatureViewWithOptions(InstanceId, FeatureViewId, headers, runtime);
}

model GetInstanceResponseBody = {
  featureDBInstanceInfo?: {
    status?: string(name='Status'),
  }(name='FeatureDBInstanceInfo'),
  gmtCreateTime?: string(name='GmtCreateTime', example='2023-07-04T11:26:09.036+08:00'),
  gmtModifiedTime?: string(name='GmtModifiedTime', example='2023-07-04T11:26:09.036+08:00'),
  message?: string(name='Message', example='Success'),
  progress?: double(name='Progress', example='0.8'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  requestId?: string(name='RequestId', example='1C5B1511-8A5B-59C3-90AF-513F9210E882'),
  status?: string(name='Status', example='Running'),
  type?: string(name='Type', example='Basic'),
}

model GetInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetInstanceResponseBody(name='body'),
}

/**
 * @summary 获取实例详细信息
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetInstanceResponse
 */
async function getInstanceWithOptions(InstanceId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetInstanceResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetInstance',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取实例详细信息
 *
 * @return GetInstanceResponse
 */
async function getInstance(InstanceId: string): GetInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getInstanceWithOptions(InstanceId, headers, runtime);
}

model GetLabelTableResponseBody = {
  datasourceId?: string(name='DatasourceId', example='1'),
  datasourceName?: string(name='DatasourceName', example='datasource1'),
  fields?: [ 
    {
      attributes?: [ string ](name='Attributes'),
      name?: string(name='Name', example='field1'),
      type?: string(name='Type', example='INT32'),
    }
  ](name='Fields'),
  gmtCreateTime?: string(name='GmtCreateTime', example='2021-12-15T23:24:33.132+08:00'),
  gmtModifiedTime?: string(name='GmtModifiedTime', example='2021-12-15T23:24:33.132+08:00'),
  name?: string(name='Name', example='label_table1'),
  owner?: string(name='Owner', example='12321312*****'),
  projectId?: string(name='ProjectId', example='1'),
  projectName?: string(name='ProjectName', example='project1'),
  relatedModelFeatures?: [ string ](name='RelatedModelFeatures'),
  requestId?: string(name='RequestId', example='728C5E01-ABF6-5AA8-B9FC-B3BA05DECC77'),
}

model GetLabelTableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetLabelTableResponseBody(name='body'),
}

/**
 * @summary 获取Label表详细信息。
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetLabelTableResponse
 */
async function getLabelTableWithOptions(InstanceId: string, LabelTableId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetLabelTableResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetLabelTable',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/labeltables/${OpenApiUtil.getEncodeParam(LabelTableId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取Label表详细信息。
 *
 * @return GetLabelTableResponse
 */
async function getLabelTable(InstanceId: string, LabelTableId: string): GetLabelTableResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getLabelTableWithOptions(InstanceId, LabelTableId, headers, runtime);
}

model GetModelFeatureResponseBody = {
  exportTrainingSetTableScript?: string(name='ExportTrainingSetTableScript', example='from feature_store_py.fs_client import FeatureStoreClient\\nfrom feature_store_py.fs_project import FeatureStoreProject\\nfrom feature_store_py.fs_datasource import LabelInput, MaxComputeDataSource, TrainingSetOutput\\nfrom feature_store_py.fs_features import FeatureSelector\\nfrom feature_store_py.fs_config import LabelInputConfig, PartitionConfig, FeatureViewConfig\\nfrom feature_store_py.fs_config import TrainSetOutputConfig, EASDeployConfig\\nimport datetime\\nimport sys\\n\\ncur_day = args[\\"dt\\"]\\nprint(\\"cur_day = \\", cur_day)\\noffset = datetime.timedelta(days=-1)\\npre_day = (datetime.datetime.strptime(cur_day, \\"%Y%m%d\\") + offset).strftime(\\"%Y%m%d\\")\\nprint(\\"pre_day = \\", pre_day)\\n\\n\\naccess_key_id = o.account.access_id\\naccess_key_secret = o.account.secret_access_key\\nfs = FeatureStoreClient(access_key_id=access_key_id, access_key_secret=access_key_secret, region=\\"cn-beijing\\")\\ncur_project_name = \\"p1\\"\\nproject = fs.get_project(cur_project_name)\\n\\nlabel_partitions = PartitionConfig(name = \\"ds\\", value = cur_day)\\nlabel_input_config = LabelInputConfig(partition_config=label_partitions)\\n\\nfeature_view_1_partitions = PartitionConfig(name = \\"ds\\", value = pre_day)\\nfeature_view_1_config = FeatureViewConfig(name = \\"user_fea\\",\\npartition_config=feature_view_1_partitions)\\n\\nfeature_view_2_partitions = PartitionConfig(name = \\"ds\\", value = pre_day)\\nfeature_view_2_config = FeatureViewConfig(name = \\"seq_fea\\",\\npartition_config=feature_view_2_partitions)\\n\\nfeature_view_3_partitions = PartitionConfig(name = \\"ds\\", value = pre_day)\\nfeature_view_3_config = FeatureViewConfig(name = \\"item_fea\\",\\npartition_config=feature_view_3_partitions)\\n\\nfeature_view_config_list = [feature_view_1_config,feature_view_2_config,feature_view_3_config]\\ntrain_set_partitions = PartitionConfig(name = \\"ds\\", value = cur_day)\\ntrain_set_output_config = TrainSetOutputConfig(partition_config=train_set_partitions)\\n\\n\\nmodel_name = \\"rank_v1\\"\\ncur_model = project.get_model(model_name)\\ntask = cur_model.export_train_set(label_input_config, feature_view_config_list, train_set_output_config)\\ntask.wait()\\nprint(\\"task_summary = \\", task.task_summary)\\n'),
  features?: [ 
    {
      aliasName?: string(name='AliasName', example='feature2'),
      featureViewId?: string(name='FeatureViewId', example='3'),
      featureViewName?: string(name='FeatureViewName', example='feature_view_1'),
      name?: string(name='Name', example='feature1'),
      type?: string(name='Type', example='INT32'),
    }
  ](name='Features'),
  gmtCreateTime?: string(name='GmtCreateTime', example='2023-07-04T14:46:22.227+08:00'),
  gmtModifiedTime?: string(name='GmtModifiedTime', example='2023-07-04T14:46:22.227+08:00'),
  labelPriorityLevel?: long(name='LabelPriorityLevel', example='0'),
  labelTableId?: string(name='LabelTableId', example='3'),
  labelTableName?: string(name='LabelTableName', example='label_table1'),
  name?: string(name='Name', example='model_feature1'),
  owner?: string(name='Owner', example='1231243253****'),
  projectId?: string(name='ProjectId', example='5'),
  projectName?: string(name='ProjectName', example='project1'),
  relations?: {
    domains?: [ 
      {
        domainType?: string(name='DomainType', example='FeatureEntity'),
        id?: string(name='Id', description='Domain ID。', example='3'),
        name?: string(name='Name', example='feature_entity_1'),
      }
    ](name='Domains'),
    links?: [ 
      {
        from?: string(name='From', example='model_feature_2'),
        link?: string(name='Link', example='user_id'),
        to?: string(name='To', example='feature_entity_3'),
      }
    ](name='Links'),
  }(name='Relations'),
  requestId?: string(name='RequestId', example='0C89F5E1-7F24-5EEC-9F05-508A39278CC8'),
  trainingSetFGTable?: string(name='TrainingSetFGTable', example='table2'),
  trainingSetTable?: string(name='TrainingSetTable', example='table1'),
}

model GetModelFeatureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetModelFeatureResponseBody(name='body'),
}

/**
 * @summary 获取模型特征详情。
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetModelFeatureResponse
 */
async function getModelFeatureWithOptions(InstanceId: string, ModelFeatureId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetModelFeatureResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetModelFeature',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/modelfeatures/${OpenApiUtil.getEncodeParam(ModelFeatureId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取模型特征详情。
 *
 * @return GetModelFeatureResponse
 */
async function getModelFeature(InstanceId: string, ModelFeatureId: string): GetModelFeatureResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getModelFeatureWithOptions(InstanceId, ModelFeatureId, headers, runtime);
}

model GetModelFeatureFGFeatureResponseBody = {
  lookupFeatures?: [ 
    {
      defaultValue?: string(name='DefaultValue', example='-1024'),
      featureName?: string(name='FeatureName', example='item_id'),
      keyFeatureDomain?: string(name='KeyFeatureDomain', example='Item'),
      keyFeatureName?: string(name='KeyFeatureName', example='1'),
      mapFeatureDomain?: string(name='MapFeatureDomain', example='User'),
      mapFeatureName?: string(name='MapFeatureName', example='item_id'),
      valueType?: string(name='ValueType', example='STRING'),
    }
  ](name='LookupFeatures'),
  rawFeatures?: [ 
    {
      defaultValue?: string(name='DefaultValue', example='-1024'),
      featureDomain?: string(name='FeatureDomain', example='User'),
      featureName?: string(name='FeatureName', example='item_id'),
      featureType?: string(name='FeatureType', example='IdFeature'),
      inputFeatureName?: string(name='InputFeatureName', example='item_id'),
      valueType?: string(name='ValueType', example='STRING'),
    }
  ](name='RawFeatures'),
  requestId?: string(name='RequestId', example='E23EFF09-58AA-5420-934F-8453AE01548D'),
  reserves?: [ string ](name='Reserves'),
  sequenceFeatures?: [ 
    {
      attributeDelim?: string(name='AttributeDelim', example='#'),
      featureName?: string(name='FeatureName', example='item_id'),
      sequenceDelim?: string(name='SequenceDelim', example=';'),
      sequenceLength?: long(name='SequenceLength', example='50'),
      subFeatures?: [ 
        {
          defaultValue?: string(name='DefaultValue', example='-1024'),
          featureDomain?: string(name='FeatureDomain', example='User'),
          featureName?: string(name='FeatureName', example='item_id'),
          featureType?: string(name='FeatureType', example='IdFeature'),
          inputFeatureName?: string(name='InputFeatureName', example='item_id'),
          valueType?: string(name='ValueType', example='STRING'),
        }
      ](name='SubFeatures'),
    }
  ](name='SequenceFeatures'),
}

model GetModelFeatureFGFeatureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetModelFeatureFGFeatureResponseBody(name='body'),
}

/**
 * @summary 获取模型特征的FG特征配置信息。
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetModelFeatureFGFeatureResponse
 */
async function getModelFeatureFGFeatureWithOptions(InstanceId: string, ModelFeatureId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetModelFeatureFGFeatureResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetModelFeatureFGFeature',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/modelfeatures/${OpenApiUtil.getEncodeParam(ModelFeatureId)}/fgfeature`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取模型特征的FG特征配置信息。
 *
 * @return GetModelFeatureFGFeatureResponse
 */
async function getModelFeatureFGFeature(InstanceId: string, ModelFeatureId: string): GetModelFeatureFGFeatureResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getModelFeatureFGFeatureWithOptions(InstanceId, ModelFeatureId, headers, runtime);
}

model GetModelFeatureFGInfoResponseBody = {
  content?: string(name='Content', example='{"features": [{"feature_name": "item_id","feature_type": "id_feature","value_type": "String","expression": "item:item_id","default_value": "-1024","combiner": "mean","need_prefix": false},{"feature_name": "f1","feature_type": "lookup_feature","value_type": "Integer","map": "item:f1","key": "user:1","default_value": "0","combiner": "mean","need_prefix": false,"needDiscrete": false,"needWeighting": false,"needKey": false}],"reserves": ["f1"]}'),
  requestId?: string(name='RequestId', example='6B662A64-E4BF-56F8-BF5F-4C63F34EC0A8'),
}

model GetModelFeatureFGInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetModelFeatureFGInfoResponseBody(name='body'),
}

/**
 * @summary 获取模型特征的fg.json文件配置信息。
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetModelFeatureFGInfoResponse
 */
async function getModelFeatureFGInfoWithOptions(InstanceId: string, ModelFeatureId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetModelFeatureFGInfoResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetModelFeatureFGInfo',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/modelfeatures/${OpenApiUtil.getEncodeParam(ModelFeatureId)}/fginfo`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取模型特征的fg.json文件配置信息。
 *
 * @return GetModelFeatureFGInfoResponse
 */
async function getModelFeatureFGInfo(InstanceId: string, ModelFeatureId: string): GetModelFeatureFGInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getModelFeatureFGInfoWithOptions(InstanceId, ModelFeatureId, headers, runtime);
}

model GetProjectResponseBody = {
  description?: string(name='Description', example='This is a test.'),
  featureEntityCount?: int32(name='FeatureEntityCount', example='10'),
  featureViewCount?: int32(name='FeatureViewCount', example='10'),
  gmtCreateTime?: string(name='GmtCreateTime', example='2021-12-15T23:24:33.132+08:00'),
  gmtModifiedTime?: string(name='GmtModifiedTime', example='2021-12-15T23:24:33.132+08:00'),
  modelCount?: int32(name='ModelCount', example='5'),
  name?: string(name='Name', example='project1'),
  offlineDatasourceId?: string(name='OfflineDatasourceId', example='4'),
  offlineDatasourceName?: string(name='OfflineDatasourceName', example='datasource1'),
  offlineDatasourceType?: string(name='OfflineDatasourceType', example='MaxCompute'),
  offlineLifecycle?: int32(name='OfflineLifecycle', example='90'),
  onlineDatasourceId?: string(name='OnlineDatasourceId', example='5'),
  onlineDatasourceName?: string(name='OnlineDatasourceName', example='datasource2'),
  onlineDatasourceType?: string(name='OnlineDatasourceType', example='Hologres'),
  owner?: string(name='Owner', example='1232132543543****'),
  requestId?: string(name='RequestId', example='C33E160C-BFCA-5719-B958-942850E949F6'),
}

model GetProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetProjectResponseBody(name='body'),
}

/**
 * @summary 获取指定Feature Store项目详细信息。
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetProjectResponse
 */
async function getProjectWithOptions(InstanceId: string, ProjectId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProjectResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetProject',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/projects/${OpenApiUtil.getEncodeParam(ProjectId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取指定Feature Store项目详细信息。
 *
 * @return GetProjectResponse
 */
async function getProject(InstanceId: string, ProjectId: string): GetProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProjectWithOptions(InstanceId, ProjectId, headers, runtime);
}

model GetProjectFeatureEntityResponseBody = {
  featureEntityId?: string(name='FeatureEntityId', example='3'),
  joinId?: string(name='JoinId', example='user_id'),
  name?: string(name='Name', example='feature_entity_1'),
  projectName?: string(name='ProjectName', example='project_1'),
  requestId?: string(name='RequestId', example='37D19490-AB69-567D-A852-407C94E510E9'),
  workspaceId?: string(name='WorkspaceId', example='34245'),
}

model GetProjectFeatureEntityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetProjectFeatureEntityResponseBody(name='body'),
}

/**
 * @summary 获取项目下特征实体详细信息
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetProjectFeatureEntityResponse
 */
async function getProjectFeatureEntityWithOptions(InstanceId: string, ProjectId: string, FeatureEntityName: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProjectFeatureEntityResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetProjectFeatureEntity',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/projects/${OpenApiUtil.getEncodeParam(ProjectId)}/featureentities/${OpenApiUtil.getEncodeParam(FeatureEntityName)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取项目下特征实体详细信息
 *
 * @return GetProjectFeatureEntityResponse
 */
async function getProjectFeatureEntity(InstanceId: string, ProjectId: string, FeatureEntityName: string): GetProjectFeatureEntityResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getProjectFeatureEntityWithOptions(InstanceId, ProjectId, FeatureEntityName, headers, runtime);
}

model GetServiceIdentityRoleResponseBody = {
  policy?: string(name='Policy', example='{
"Version": "1",
"Statement":[]
}'),
  requestId?: string(name='RequestId', example='6F629E92-F64D-502D-85AA-A9C54894CA3D'),
  roleName?: string(name='RoleName', example='AliyunServiceRoleForPaiFeatureStore'),
}

model GetServiceIdentityRoleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetServiceIdentityRoleResponseBody(name='body'),
}

/**
 * @summary 获取feature store服务账户角色。
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetServiceIdentityRoleResponse
 */
async function getServiceIdentityRoleWithOptions(RoleName: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetServiceIdentityRoleResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetServiceIdentityRole',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/serviceidentityroles/${OpenApiUtil.getEncodeParam(RoleName)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取feature store服务账户角色。
 *
 * @return GetServiceIdentityRoleResponse
 */
async function getServiceIdentityRole(RoleName: string): GetServiceIdentityRoleResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getServiceIdentityRoleWithOptions(RoleName, headers, runtime);
}

model GetTaskResponseBody = {
  config?: string(name='Config', example='{
	"mode": "overwrite",
	"partitions": {
		"dt": "20230820"
	},
	"event_time": "",
	"config": {},
	"offline_to_online": true
}'),
  gmtCreateTime?: string(name='GmtCreateTime', example='2023-07-04T11:26:09.036+08:00'),
  gmtExecutedTime?: string(name='GmtExecutedTime', example='2023-07-04T11:26:09.036+08:00'),
  gmtFinishedTime?: string(name='GmtFinishedTime', example='2023-07-04T11:26:09.036+08:00'),
  gmtModifiedTime?: string(name='GmtModifiedTime', example='2023-07-04T11:26:09.036+08:00'),
  objectId?: string(name='ObjectId', example='3'),
  objectType?: string(name='ObjectType', example='ModelFeature'),
  projectId?: string(name='ProjectId', example='3'),
  projectName?: string(name='ProjectName', example='project_1'),
  requestId?: string(name='RequestId', example='37D19490-AB69-567D-A852-407C94E510E9'),
  runningConfig?: string(name='RunningConfig', example='DROP TABLE IF EXISTS public.fsxxx'),
  status?: string(name='Status', example='Running'),
  type?: string(name='Type', example='OfflineToOnline'),
}

model GetTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTaskResponseBody(name='body'),
}

/**
 * @summary 获取任务详情
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTaskResponse
 */
async function getTaskWithOptions(InstanceId: string, TaskId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetTaskResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'GetTask',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/tasks/${OpenApiUtil.getEncodeParam(TaskId)}`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取任务详情
 *
 * @return GetTaskResponse
 */
async function getTask(InstanceId: string, TaskId: string): GetTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getTaskWithOptions(InstanceId, TaskId, headers, runtime);
}

model ListDatasourceTablesRequest {
  tableName?: string(name='TableName', example='table1'),
}

model ListDatasourceTablesResponseBody = {
  requestId?: string(name='RequestId', example='C03B2680-AC9C-59CD-93C5-8142B92537FA'),
  tables?: [ string ](name='Tables'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ListDatasourceTablesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDatasourceTablesResponseBody(name='body'),
}

/**
 * @summary 获取数据源下所有表。
 *
 * @param request ListDatasourceTablesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDatasourceTablesResponse
 */
async function listDatasourceTablesWithOptions(InstanceId: string, DatasourceId: string, request: ListDatasourceTablesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListDatasourceTablesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.tableName)) {
    query['TableName'] = request.tableName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDatasourceTables',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/datasources/${OpenApiUtil.getEncodeParam(DatasourceId)}/tables`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取数据源下所有表。
 *
 * @param request ListDatasourceTablesRequest
 * @return ListDatasourceTablesResponse
 */
async function listDatasourceTables(InstanceId: string, DatasourceId: string, request: ListDatasourceTablesRequest): ListDatasourceTablesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listDatasourceTablesWithOptions(InstanceId, DatasourceId, request, headers, runtime);
}

model ListDatasourcesRequest {
  name?: string(name='Name', example='datasource1'),
  order?: string(name='Order', example='Asc'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  sortBy?: string(name='SortBy', example='GmtModifiedTime'),
  type?: string(name='Type', example='MaxCompute'),
  workspaceId?: string(name='WorkspaceId', example='234'),
}

model ListDatasourcesResponseBody = {
  datasources?: [ 
    {
      config?: string(name='Config', example='{"address": ""}'),
      datasourceId?: string(name='DatasourceId', example='3'),
      gmtCreateTime?: string(name='GmtCreateTime', example='2021-12-15T23:24:33.132+08:00'),
      gmtModifiedTime?: string(name='GmtModifiedTime', example='2021-12-15T23:24:33.132+08:00'),
      name?: string(name='Name', example='datasource1'),
      type?: string(name='Type', example='Hologres'),
      uri?: string(name='Uri', example='igraph_instance1'),
      workspaceId?: string(name='WorkspaceId', example='32324'),
    }
  ](name='Datasources'),
  requestId?: string(name='RequestId', example='44933189-493B-5C43-A5C6-11EEC2A43520'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ListDatasourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDatasourcesResponseBody(name='body'),
}

/**
 * @summary 获取数据源列表。
 *
 * @param request ListDatasourcesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDatasourcesResponse
 */
async function listDatasourcesWithOptions(InstanceId: string, request: ListDatasourcesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListDatasourcesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListDatasources',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/datasources`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取数据源列表。
 *
 * @param request ListDatasourcesRequest
 * @return ListDatasourcesResponse
 */
async function listDatasources(InstanceId: string, request: ListDatasourcesRequest): ListDatasourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listDatasourcesWithOptions(InstanceId, request, headers, runtime);
}

model ListFeatureEntitiesRequest {
  featureEntityIds?: [ string ](name='FeatureEntityIds'),
  name?: string(name='Name', example='feature_entity_1'),
  order?: string(name='Order', example='Desc'),
  owner?: string(name='Owner', example='1231432*****'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  projectId?: string(name='ProjectId', example='3'),
  sortBy?: string(name='SortBy', example='GmtModifiedTime'),
}

model ListFeatureEntitiesShrinkRequest {
  featureEntityIdsShrink?: string(name='FeatureEntityIds'),
  name?: string(name='Name', example='feature_entity_1'),
  order?: string(name='Order', example='Desc'),
  owner?: string(name='Owner', example='1231432*****'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  projectId?: string(name='ProjectId', example='3'),
  sortBy?: string(name='SortBy', example='GmtModifiedTime'),
}

model ListFeatureEntitiesResponseBody = {
  featureEntities?: [ 
    {
      featureEntityId?: string(name='FeatureEntityId', example='3'),
      gmtCreateTime?: string(name='GmtCreateTime', example='2021-12-15T23:24:33.132+08:00'),
      joinId?: string(name='JoinId', example='user_id'),
      name?: string(name='Name', example='feature_entity_1'),
      owner?: string(name='Owner', example='123456789****'),
      projectId?: string(name='ProjectId', example='3'),
      projectName?: string(name='ProjectName', example='project_1'),
    }
  ](name='FeatureEntities'),
  requestId?: string(name='RequestId', example='37D19490-AB69-567D-A852-407C94E510E9'),
  totalCount?: int32(name='TotalCount', example='10'),
}

model ListFeatureEntitiesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFeatureEntitiesResponseBody(name='body'),
}

/**
 * @summary 创建特征实体列表
 *
 * @param tmpReq ListFeatureEntitiesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListFeatureEntitiesResponse
 */
async function listFeatureEntitiesWithOptions(InstanceId: string, tmpReq: ListFeatureEntitiesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListFeatureEntitiesResponse {
  Util.validateModel(tmpReq);
  var request = new ListFeatureEntitiesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.featureEntityIds)) {
    request.featureEntityIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.featureEntityIds, 'FeatureEntityIds', 'simple');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.featureEntityIdsShrink)) {
    query['FeatureEntityIds'] = request.featureEntityIdsShrink;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.owner)) {
    query['Owner'] = request.owner;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListFeatureEntities',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/featureentities`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建特征实体列表
 *
 * @param request ListFeatureEntitiesRequest
 * @return ListFeatureEntitiesResponse
 */
async function listFeatureEntities(InstanceId: string, request: ListFeatureEntitiesRequest): ListFeatureEntitiesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listFeatureEntitiesWithOptions(InstanceId, request, headers, runtime);
}

model ListFeatureViewFieldRelationshipsResponseBody = {
  relationships?: [ 
    {
      featureName?: string(name='FeatureName', example='featureView1'),
      models?: [ 
        {
          featureAliasName?: string(name='FeatureAliasName', example='f1'),
          modelId?: string(name='ModelId', example='3'),
          modelName?: string(name='ModelName', example='dbmtl'),
        }
      ](name='Models'),
      offlineTableName?: string(name='OfflineTableName', example='table2'),
      onlineTableName?: string(name='OnlineTableName', example='table1'),
    }
  ](name='Relationships'),
  requestId?: string(name='RequestId', example='BF349686-C932-55B5-9B31-DAFA395C0E06'),
}

model ListFeatureViewFieldRelationshipsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFeatureViewFieldRelationshipsResponseBody(name='body'),
}

/**
 * @summary 获取特征字段血缘关系。
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListFeatureViewFieldRelationshipsResponse
 */
async function listFeatureViewFieldRelationshipsWithOptions(InstanceId: string, FeatureViewId: string, FieldName: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListFeatureViewFieldRelationshipsResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'ListFeatureViewFieldRelationships',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/featureviews/${OpenApiUtil.getEncodeParam(FeatureViewId)}/fields/${OpenApiUtil.getEncodeParam(FieldName)}/relationships`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取特征字段血缘关系。
 *
 * @return ListFeatureViewFieldRelationshipsResponse
 */
async function listFeatureViewFieldRelationships(InstanceId: string, FeatureViewId: string, FieldName: string): ListFeatureViewFieldRelationshipsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listFeatureViewFieldRelationshipsWithOptions(InstanceId, FeatureViewId, FieldName, headers, runtime);
}

model ListFeatureViewOnlineFeaturesRequest {
  joinIds?: [ string ](name='JoinIds', description='This parameter is required.'),
}

model ListFeatureViewOnlineFeaturesShrinkRequest {
  joinIdsShrink?: string(name='JoinIds', description='This parameter is required.'),
}

model ListFeatureViewOnlineFeaturesResponseBody = {
  onlineFeatures?: [ string ](name='OnlineFeatures'),
  requestId?: string(name='RequestId', example='BF349686-C932-55B5-9B31-DAFA395C0E06'),
}

model ListFeatureViewOnlineFeaturesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFeatureViewOnlineFeaturesResponseBody(name='body'),
}

/**
 * @summary 获取特征视图下的在线特征数据。
 *
 * @param tmpReq ListFeatureViewOnlineFeaturesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListFeatureViewOnlineFeaturesResponse
 */
async function listFeatureViewOnlineFeaturesWithOptions(InstanceId: string, FeatureViewId: string, tmpReq: ListFeatureViewOnlineFeaturesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListFeatureViewOnlineFeaturesResponse {
  Util.validateModel(tmpReq);
  var request = new ListFeatureViewOnlineFeaturesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.joinIds)) {
    request.joinIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.joinIds, 'JoinIds', 'json');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.joinIdsShrink)) {
    query['JoinIds'] = request.joinIdsShrink;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListFeatureViewOnlineFeatures',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/featureviews/${OpenApiUtil.getEncodeParam(FeatureViewId)}/onlinefeatures`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取特征视图下的在线特征数据。
 *
 * @param request ListFeatureViewOnlineFeaturesRequest
 * @return ListFeatureViewOnlineFeaturesResponse
 */
async function listFeatureViewOnlineFeatures(InstanceId: string, FeatureViewId: string, request: ListFeatureViewOnlineFeaturesRequest): ListFeatureViewOnlineFeaturesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listFeatureViewOnlineFeaturesWithOptions(InstanceId, FeatureViewId, request, headers, runtime);
}

model ListFeatureViewRelationshipsResponseBody = {
  relationships?: [ 
    {
      featureViewName?: string(name='FeatureViewName', example='fv1'),
      models?: [ 
        {
          modelId?: string(name='ModelId', example='3'),
          modelName?: string(name='ModelName', example='dbmtl'),
        }
      ](name='Models'),
      projectName?: string(name='ProjectName', example='project1'),
    }
  ](name='Relationships'),
  requestId?: string(name='RequestId', example='0FBBE454-9BD1-5D8F-9129-D14DB7FAFE0B'),
}

model ListFeatureViewRelationshipsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFeatureViewRelationshipsResponseBody(name='body'),
}

/**
 * @summary 获取特征视图血缘关系。
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListFeatureViewRelationshipsResponse
 */
async function listFeatureViewRelationshipsWithOptions(InstanceId: string, FeatureViewId: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListFeatureViewRelationshipsResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'ListFeatureViewRelationships',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/featureviews/${OpenApiUtil.getEncodeParam(FeatureViewId)}/relationships`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取特征视图血缘关系。
 *
 * @return ListFeatureViewRelationshipsResponse
 */
async function listFeatureViewRelationships(InstanceId: string, FeatureViewId: string): ListFeatureViewRelationshipsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listFeatureViewRelationshipsWithOptions(InstanceId, FeatureViewId, headers, runtime);
}

model ListFeatureViewsRequest {
  featureName?: string(name='FeatureName', example='feature1'),
  featureViewIds?: [ string ](name='FeatureViewIds'),
  name?: string(name='Name', example='fv1'),
  order?: string(name='Order', example='Desc'),
  owner?: string(name='Owner', example='1232143243242****'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  projectId?: string(name='ProjectId', example='3'),
  sortBy?: string(name='SortBy', example='GmtCreateTime'),
  tag?: string(name='Tag', example='tag1'),
  type?: string(name='Type', example='Batch'),
}

model ListFeatureViewsShrinkRequest {
  featureName?: string(name='FeatureName', example='feature1'),
  featureViewIdsShrink?: string(name='FeatureViewIds'),
  name?: string(name='Name', example='fv1'),
  order?: string(name='Order', example='Desc'),
  owner?: string(name='Owner', example='1232143243242****'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  projectId?: string(name='ProjectId', example='3'),
  sortBy?: string(name='SortBy', example='GmtCreateTime'),
  tag?: string(name='Tag', example='tag1'),
  type?: string(name='Type', example='Batch'),
}

model ListFeatureViewsResponseBody = {
  featureViews?: [ 
    {
      featureEntityName?: string(name='FeatureEntityName', example='featureEntity1'),
      featureViewId?: string(name='FeatureViewId', example='3'),
      gmtCreateTime?: string(name='GmtCreateTime', example='2021-12-15T23:24:33.132+08:00'),
      gmtModifiedTime?: string(name='GmtModifiedTime', example='2021-12-15T23:24:33.132+08:00'),
      name?: string(name='Name', example='featureView1'),
      owner?: string(name='Owner', example='12321421412****'),
      projectId?: string(name='ProjectId', example='3'),
      projectName?: string(name='ProjectName', example='project1'),
      registerDatasourceId?: string(name='RegisterDatasourceId', example='4'),
      registerDatasourceName?: string(name='RegisterDatasourceName', example='datasource1'),
      registerTable?: string(name='RegisterTable', example='table1'),
      TTL?: int32(name='TTL', example='90'),
      type?: string(name='Type', example='Batch'),
      writeToFeatureDB?: boolean(name='WriteToFeatureDB'),
    }
  ](name='FeatureViews'),
  requestId?: string(name='RequestId', example='C03B2680-AC9C-59CD-93C5-8142B92537FA'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ListFeatureViewsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFeatureViewsResponseBody(name='body'),
}

/**
 * @summary 获取特征视图列表。
 *
 * @param tmpReq ListFeatureViewsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListFeatureViewsResponse
 */
async function listFeatureViewsWithOptions(InstanceId: string, tmpReq: ListFeatureViewsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListFeatureViewsResponse {
  Util.validateModel(tmpReq);
  var request = new ListFeatureViewsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.featureViewIds)) {
    request.featureViewIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.featureViewIds, 'FeatureViewIds', 'simple');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.featureName)) {
    query['FeatureName'] = request.featureName;
  }
  if (!Util.isUnset(request.featureViewIdsShrink)) {
    query['FeatureViewIds'] = request.featureViewIdsShrink;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.owner)) {
    query['Owner'] = request.owner;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListFeatureViews',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/featureviews`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取特征视图列表。
 *
 * @param request ListFeatureViewsRequest
 * @return ListFeatureViewsResponse
 */
async function listFeatureViews(InstanceId: string, request: ListFeatureViewsRequest): ListFeatureViewsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listFeatureViewsWithOptions(InstanceId, request, headers, runtime);
}

model ListInstancesRequest {
  order?: string(name='Order', example='DESC'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  sortBy?: string(name='SortBy', example='GmtCreateTime'),
  status?: string(name='Status', example='Running'),
}

model ListInstancesResponseBody = {
  instances?: [ 
    {
      featureDBInstanceInfo?: {
        status?: string(name='Status'),
      }(name='FeatureDBInstanceInfo'),
      gmtCreateTime?: string(name='GmtCreateTime', example='2023-07-04T11:26:09.036+08:00'),
      gmtModifiedTime?: string(name='GmtModifiedTime', example='2023-07-04T11:26:09.036+08:00'),
      instanceId?: string(name='InstanceId', example='featureStore-cn-7mz2xfu****'),
      regionId?: string(name='RegionId', example='cn-hangzhou'),
      status?: string(name='Status', example='Initializing'),
      type?: string(name='Type', example='Basic'),
    }
  ](name='Instances'),
  requestId?: string(name='RequestId', example='2CA11923-2A3D-5E5A-8314-E699D2DD15DE'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ListInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListInstancesResponseBody(name='body'),
}

/**
 * @summary 获取Feature Store实例列表。
 *
 * @param request ListInstancesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListInstancesResponse
 */
async function listInstancesWithOptions(request: ListInstancesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListInstancesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListInstances',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取Feature Store实例列表。
 *
 * @param request ListInstancesRequest
 * @return ListInstancesResponse
 */
async function listInstances(request: ListInstancesRequest): ListInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listInstancesWithOptions(request, headers, runtime);
}

model ListLabelTablesRequest {
  labelTableIds?: [ string ](name='LabelTableIds'),
  name?: string(name='Name', example='label_table1'),
  order?: string(name='Order', example='Asc'),
  owner?: string(name='Owner', example='1231432432****'),
  pageNumber?: long(name='PageNumber', example='10'),
  pageSize?: long(name='PageSize', example='1'),
  projectId?: string(name='ProjectId', example='project1'),
  sortBy?: string(name='SortBy', example='GmtModifiedTime'),
}

model ListLabelTablesShrinkRequest {
  labelTableIdsShrink?: string(name='LabelTableIds'),
  name?: string(name='Name', example='label_table1'),
  order?: string(name='Order', example='Asc'),
  owner?: string(name='Owner', example='1231432432****'),
  pageNumber?: long(name='PageNumber', example='10'),
  pageSize?: long(name='PageSize', example='1'),
  projectId?: string(name='ProjectId', example='project1'),
  sortBy?: string(name='SortBy', example='GmtModifiedTime'),
}

model ListLabelTablesResponseBody = {
  labelTables?: [ 
    {
      datasourceId?: string(name='DatasourceId', example='3'),
      datasourceName?: string(name='DatasourceName', example='datasource1'),
      gmtCreateTime?: string(name='GmtCreateTime', example='2021-12-15T23:24:33.132+08:00'),
      gmtModifiedTime?: string(name='GmtModifiedTime', example='2021-12-15T23:24:33.132+08:00'),
      labelTableId?: string(name='LabelTableId', example='3'),
      name?: string(name='Name', example='label_table1'),
      owner?: string(name='Owner', example='123214213214'),
      projectId?: string(name='ProjectId', example='1'),
      projectName?: string(name='ProjectName', example='project1'),
    }
  ](name='LabelTables'),
  requestId?: string(name='RequestId', example='728C5E01-ABF6-5AA8-B9FC-B3BA05DECC77'),
  totalCount?: long(name='TotalCount', example='21'),
}

model ListLabelTablesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListLabelTablesResponseBody(name='body'),
}

/**
 * @summary 获取Label表列表。
 *
 * @param tmpReq ListLabelTablesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListLabelTablesResponse
 */
async function listLabelTablesWithOptions(InstanceId: string, tmpReq: ListLabelTablesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListLabelTablesResponse {
  Util.validateModel(tmpReq);
  var request = new ListLabelTablesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.labelTableIds)) {
    request.labelTableIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.labelTableIds, 'LabelTableIds', 'simple');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.labelTableIdsShrink)) {
    query['LabelTableIds'] = request.labelTableIdsShrink;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.owner)) {
    query['Owner'] = request.owner;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListLabelTables',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/labeltables`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取Label表列表。
 *
 * @param request ListLabelTablesRequest
 * @return ListLabelTablesResponse
 */
async function listLabelTables(InstanceId: string, request: ListLabelTablesRequest): ListLabelTablesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listLabelTablesWithOptions(InstanceId, request, headers, runtime);
}

model ListModelFeatureAvailableFeaturesRequest {
  featureName?: string(name='FeatureName', example='f1'),
}

model ListModelFeatureAvailableFeaturesResponseBody = {
  avaliableFeatures?: [ 
    {
      name?: string(name='Name', example='age'),
      sourceName?: string(name='SourceName', example='user_fea'),
      sourceType?: string(name='SourceType', example='FeatureView'),
      type?: string(name='Type', example='STRING'),
    }
  ](name='AvaliableFeatures'),
  totalCount?: long(name='TotalCount', example='10'),
  requestId?: string(name='requestId', example='ED4DEA2F-F216-57F0-AE28-08D791233280'),
}

model ListModelFeatureAvailableFeaturesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListModelFeatureAvailableFeaturesResponseBody(name='body'),
}

/**
 * @summary 获取注册FG特征时模型特征下可选的所有特征。
 *
 * @param request ListModelFeatureAvailableFeaturesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListModelFeatureAvailableFeaturesResponse
 */
async function listModelFeatureAvailableFeaturesWithOptions(InstanceId: string, ModelFeatureId: string, request: ListModelFeatureAvailableFeaturesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListModelFeatureAvailableFeaturesResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.featureName)) {
    query['FeatureName'] = request.featureName;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListModelFeatureAvailableFeatures',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/modelfeatures/${OpenApiUtil.getEncodeParam(ModelFeatureId)}/availablefeatures`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取注册FG特征时模型特征下可选的所有特征。
 *
 * @param request ListModelFeatureAvailableFeaturesRequest
 * @return ListModelFeatureAvailableFeaturesResponse
 */
async function listModelFeatureAvailableFeatures(InstanceId: string, ModelFeatureId: string, request: ListModelFeatureAvailableFeaturesRequest): ListModelFeatureAvailableFeaturesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listModelFeatureAvailableFeaturesWithOptions(InstanceId, ModelFeatureId, request, headers, runtime);
}

model ListModelFeaturesRequest {
  modelFeatureIds?: [ string ](name='ModelFeatureIds'),
  name?: string(name='Name', example='model_feature1'),
  order?: string(name='Order', example='ASC'),
  owner?: string(name='Owner', example='12323143****'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  projectId?: string(name='ProjectId', example='4'),
  sortBy?: string(name='SortBy', example='DESC'),
}

model ListModelFeaturesShrinkRequest {
  modelFeatureIdsShrink?: string(name='ModelFeatureIds'),
  name?: string(name='Name', example='model_feature1'),
  order?: string(name='Order', example='ASC'),
  owner?: string(name='Owner', example='12323143****'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  projectId?: string(name='ProjectId', example='4'),
  sortBy?: string(name='SortBy', example='DESC'),
}

model ListModelFeaturesResponseBody = {
  modelFeatures?: [ 
    {
      gmtCreateTime?: string(name='GmtCreateTime', example='2023-07-04T14:46:22.227+08:00'),
      gmtModifiedTime?: string(name='GmtModifiedTime', example='2023-07-04T14:46:22.227+08:00'),
      labelTableName?: string(name='LabelTableName', example='label_table_1'),
      modelFeatureId?: string(name='ModelFeatureId', example='3'),
      name?: string(name='Name', example='model_feature1'),
      owner?: string(name='Owner', example='1231243253****'),
      projectId?: string(name='ProjectId', example='5'),
      projectName?: string(name='ProjectName', example='project1'),
    }
  ](name='ModelFeatures'),
  requestId?: string(name='RequestId', example='2CA11923-2A3D-5E5A-8314-E699D2DD15DE'),
  totalCount?: long(name='TotalCount', example='4'),
}

model ListModelFeaturesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListModelFeaturesResponseBody(name='body'),
}

/**
 * @summary 获取模型特征列表。
 *
 * @param tmpReq ListModelFeaturesRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListModelFeaturesResponse
 */
async function listModelFeaturesWithOptions(InstanceId: string, tmpReq: ListModelFeaturesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListModelFeaturesResponse {
  Util.validateModel(tmpReq);
  var request = new ListModelFeaturesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.modelFeatureIds)) {
    request.modelFeatureIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.modelFeatureIds, 'ModelFeatureIds', 'simple');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.modelFeatureIdsShrink)) {
    query['ModelFeatureIds'] = request.modelFeatureIdsShrink;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.owner)) {
    query['Owner'] = request.owner;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListModelFeatures',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/modelfeatures`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取模型特征列表。
 *
 * @param request ListModelFeaturesRequest
 * @return ListModelFeaturesResponse
 */
async function listModelFeatures(InstanceId: string, request: ListModelFeaturesRequest): ListModelFeaturesResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listModelFeaturesWithOptions(InstanceId, request, headers, runtime);
}

model ListProjectFeatureViewsResponseBody = {
  featureViews?: [ 
    {
      featureViewId?: string(name='FeatureViewId', example='3'),
      features?: [ 
        {
          attributes?: [ string ](name='Attributes'),
          name?: string(name='Name', example='f1'),
          type?: string(name='Type', example='INT32'),
        }
      ](name='Features'),
      name?: string(name='Name', example='feature_view1'),
      type?: string(name='Type'),
    }
  ](name='FeatureViews'),
  requestId?: string(name='RequestId', example='AE2AF33E-0C0D-51A8-B89B-C5F1DF261D92'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ListProjectFeatureViewsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProjectFeatureViewsResponseBody(name='body'),
}

/**
 * @summary 获取项目下的所有特征视图、特征信息。
 *
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProjectFeatureViewsResponse
 */
async function listProjectFeatureViewsWithOptions(InstanceId: string, ProjectId: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListProjectFeatureViewsResponse {
  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
  };
  var params = new OpenApi.Params{
    action = 'ListProjectFeatureViews',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/projects/${OpenApiUtil.getEncodeParam(ProjectId)}/featureviews`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取项目下的所有特征视图、特征信息。
 *
 * @return ListProjectFeatureViewsResponse
 */
async function listProjectFeatureViews(InstanceId: string, ProjectId: string): ListProjectFeatureViewsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProjectFeatureViewsWithOptions(InstanceId, ProjectId, headers, runtime);
}

model ListProjectsRequest {
  name?: string(name='Name', example='fs1'),
  order?: string(name='Order', example='Asc'),
  owner?: string(name='Owner', example='134324352****'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  projectIds?: [ string ](name='ProjectIds'),
  sortBy?: string(name='SortBy', example='GmtModifiedTime'),
  workspaceId?: string(name='WorkspaceId', example='234'),
}

model ListProjectsShrinkRequest {
  name?: string(name='Name', example='fs1'),
  order?: string(name='Order', example='Asc'),
  owner?: string(name='Owner', example='134324352****'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  projectIdsShrink?: string(name='ProjectIds'),
  sortBy?: string(name='SortBy', example='GmtModifiedTime'),
  workspaceId?: string(name='WorkspaceId', example='234'),
}

model ListProjectsResponseBody = {
  projects?: [ 
    {
      description?: string(name='Description', example='This is a test.'),
      featureEntityCount?: int32(name='FeatureEntityCount', example='10'),
      featureViewCount?: int32(name='FeatureViewCount', example='10'),
      gmtCreateTime?: string(name='GmtCreateTime', example='2021-12-15T23:24:33.132+08:00'),
      gmtModifiedTime?: string(name='GmtModifiedTime', example='2021-12-15T23:24:33.132+08:00'),
      modelCount?: int32(name='ModelCount', example='5'),
      name?: string(name='Name', example='project1'),
      offlineDatasourceId?: string(name='OfflineDatasourceId', example='4'),
      offlineDatasourceName?: string(name='OfflineDatasourceName', example='datasource1'),
      offlineDatasourceType?: string(name='OfflineDatasourceType', example='MaxCompute'),
      offlineLifecycle?: int32(name='OfflineLifecycle', example='10'),
      onlineDatasourceId?: string(name='OnlineDatasourceId', example='5'),
      onlineDatasourceName?: string(name='OnlineDatasourceName', example='datasource2'),
      onlineDatasourceType?: string(name='OnlineDatasourceType', example='Hologres'),
      owner?: string(name='Owner', example='1232132543543****'),
      projectId?: string(name='ProjectId', example='3'),
    }
  ](name='Projects'),
  requestId?: string(name='RequestId', example='44933189-493B-5C43-A5C6-11EEC2A43520'),
  totalCount?: long(name='TotalCount', example='10'),
}

model ListProjectsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListProjectsResponseBody(name='body'),
}

/**
 * @summary 获取Feature Store项目列表。
 *
 * @param tmpReq ListProjectsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListProjectsResponse
 */
async function listProjectsWithOptions(InstanceId: string, tmpReq: ListProjectsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProjectsResponse {
  Util.validateModel(tmpReq);
  var request = new ListProjectsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.projectIds)) {
    request.projectIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.projectIds, 'ProjectIds', 'simple');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.owner)) {
    query['Owner'] = request.owner;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.projectIdsShrink)) {
    query['ProjectIds'] = request.projectIdsShrink;
  }
  if (!Util.isUnset(request.sortBy)) {
    query['SortBy'] = request.sortBy;
  }
  if (!Util.isUnset(request.workspaceId)) {
    query['WorkspaceId'] = request.workspaceId;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListProjects',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/projects`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取Feature Store项目列表。
 *
 * @param request ListProjectsRequest
 * @return ListProjectsResponse
 */
async function listProjects(InstanceId: string, request: ListProjectsRequest): ListProjectsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listProjectsWithOptions(InstanceId, request, headers, runtime);
}

model ListTaskLogsRequest {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model ListTaskLogsResponseBody = {
  logs?: [ string ](name='Logs'),
  requestId?: string(name='RequestId', example='72F15A8A-5A28-5B18-A0DE-0EABD7D3245A'),
  totalCount?: int32(name='TotalCount', example='100'),
}

model ListTaskLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTaskLogsResponseBody(name='body'),
}

/**
 * @summary 获取任务日志列表
 *
 * @param request ListTaskLogsRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTaskLogsResponse
 */
async function listTaskLogsWithOptions(InstanceId: string, TaskId: string, request: ListTaskLogsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListTaskLogsResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTaskLogs',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/tasks/${OpenApiUtil.getEncodeParam(TaskId)}/logs`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取任务日志列表
 *
 * @param request ListTaskLogsRequest
 * @return ListTaskLogsResponse
 */
async function listTaskLogs(InstanceId: string, TaskId: string, request: ListTaskLogsRequest): ListTaskLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listTaskLogsWithOptions(InstanceId, TaskId, request, headers, runtime);
}

model ListTasksRequest {
  objectId?: string(name='ObjectId', example='4'),
  objectType?: string(name='ObjectType', example='ModelFeature'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  projectId?: string(name='ProjectId', example='4'),
  status?: string(name='Status', example='Running'),
  taskIds?: [ string ](name='TaskIds'),
  type?: string(name='Type', example='OfflineToOnline'),
}

model ListTasksShrinkRequest {
  objectId?: string(name='ObjectId', example='4'),
  objectType?: string(name='ObjectType', example='ModelFeature'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  projectId?: string(name='ProjectId', example='4'),
  status?: string(name='Status', example='Running'),
  taskIdsShrink?: string(name='TaskIds'),
  type?: string(name='Type', example='OfflineToOnline'),
}

model ListTasksResponseBody = {
  requestId?: string(name='RequestId', example='C33E160C-BFCA-5719-B958-942850E949F6'),
  tasks?: [ 
    {
      gmtCreateTime?: string(name='GmtCreateTime', example='2023-07-04T11:26:09.036+08:00'),
      gmtExecutedTime?: string(name='GmtExecutedTime', example='2023-07-04T11:26:09.036+08:00'),
      gmtFinishedTime?: string(name='GmtFinishedTime', example='2023-07-04T11:26:09.036+08:00'),
      objectId?: string(name='ObjectId', example='5'),
      objectType?: string(name='ObjectType', example='ModelFeature'),
      projectId?: string(name='ProjectId', example='4'),
      projectName?: string(name='ProjectName', example='project_1'),
      status?: string(name='Status', example='Running'),
      taskId?: string(name='TaskId', example='4'),
      type?: string(name='Type', example='OfflineToOnline'),
    }
  ](name='Tasks'),
  totalCount?: int32(name='TotalCount', example='10'),
}

model ListTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTasksResponseBody(name='body'),
}

/**
 * @summary 获取任务列表
 *
 * @param tmpReq ListTasksRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTasksResponse
 */
async function listTasksWithOptions(InstanceId: string, tmpReq: ListTasksRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListTasksResponse {
  Util.validateModel(tmpReq);
  var request = new ListTasksShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.taskIds)) {
    request.taskIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.taskIds, 'TaskIds', 'simple');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.objectId)) {
    query['ObjectId'] = request.objectId;
  }
  if (!Util.isUnset(request.objectType)) {
    query['ObjectType'] = request.objectType;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.projectId)) {
    query['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.taskIdsShrink)) {
    query['TaskIds'] = request.taskIdsShrink;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTasks',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/tasks`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取任务列表
 *
 * @param request ListTasksRequest
 * @return ListTasksResponse
 */
async function listTasks(InstanceId: string, request: ListTasksRequest): ListTasksResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return listTasksWithOptions(InstanceId, request, headers, runtime);
}

model PublishFeatureViewTableRequest {
  config?: string(name='Config', example='{}'),
  eventTime?: string(name='EventTime', example='2021-12-15T23:24:33.132+08:00'),
  mode?: string(name='Mode', description='This parameter is required.', example='Overwrite'),
  offlineToOnline?: boolean(name='OfflineToOnline', description='This parameter is required.', example='true'),
  partitions?: map[string]object(name='Partitions'),
}

model PublishFeatureViewTableResponseBody = {
  requestId?: string(name='RequestId', example='627B5776-4D06-5A49-8A04-508AA39653F4'),
  taskId?: string(name='TaskId'),
}

model PublishFeatureViewTableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PublishFeatureViewTableResponseBody(name='body'),
}

/**
 * @summary 将特征视图的离线数据发布/同步到线上。
 *
 * @param request PublishFeatureViewTableRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return PublishFeatureViewTableResponse
 */
async function publishFeatureViewTableWithOptions(InstanceId: string, FeatureViewId: string, request: PublishFeatureViewTableRequest, headers: map[string]string, runtime: Util.RuntimeOptions): PublishFeatureViewTableResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.config)) {
    body['Config'] = request.config;
  }
  if (!Util.isUnset(request.eventTime)) {
    body['EventTime'] = request.eventTime;
  }
  if (!Util.isUnset(request.mode)) {
    body['Mode'] = request.mode;
  }
  if (!Util.isUnset(request.offlineToOnline)) {
    body['OfflineToOnline'] = request.offlineToOnline;
  }
  if (!Util.isUnset(request.partitions)) {
    body['Partitions'] = request.partitions;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'PublishFeatureViewTable',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/featureviews/${OpenApiUtil.getEncodeParam(FeatureViewId)}/action/publishtable`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 将特征视图的离线数据发布/同步到线上。
 *
 * @param request PublishFeatureViewTableRequest
 * @return PublishFeatureViewTableResponse
 */
async function publishFeatureViewTable(InstanceId: string, FeatureViewId: string, request: PublishFeatureViewTableRequest): PublishFeatureViewTableResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return publishFeatureViewTableWithOptions(InstanceId, FeatureViewId, request, headers, runtime);
}

model UpdateDatasourceRequest {
  config?: string(name='Config', example='{"address": ""}'),
  name?: string(name='Name', description='This parameter is required.', example='datasource1'),
  uri?: string(name='Uri', description='This parameter is required.', example='igraph_instance1'),
}

model UpdateDatasourceResponseBody = {
  requestId?: string(name='RequestId', example='C33E160C-BFCA-5719-B958-942850E949F6'),
}

model UpdateDatasourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateDatasourceResponseBody(name='body'),
}

/**
 * @summary 更新数据源信息。
 *
 * @param request UpdateDatasourceRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateDatasourceResponse
 */
async function updateDatasourceWithOptions(InstanceId: string, DatasourceId: string, request: UpdateDatasourceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateDatasourceResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.config)) {
    body['Config'] = request.config;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.uri)) {
    body['Uri'] = request.uri;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateDatasource',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/datasources/${OpenApiUtil.getEncodeParam(DatasourceId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新数据源信息。
 *
 * @param request UpdateDatasourceRequest
 * @return UpdateDatasourceResponse
 */
async function updateDatasource(InstanceId: string, DatasourceId: string, request: UpdateDatasourceRequest): UpdateDatasourceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateDatasourceWithOptions(InstanceId, DatasourceId, request, headers, runtime);
}

model UpdateLabelTableRequest {
  datasourceId?: string(name='DatasourceId', example='3'),
  fields?: [ 
    {
      attributes?: [ string ](name='Attributes', description='This parameter is required.'),
      name?: string(name='Name', description='This parameter is required.', example='lat'),
      type?: string(name='Type', description='This parameter is required.', example='DOUBLE'),
    }
  ](name='Fields', description='This parameter is required.'),
  name?: string(name='Name', example='rec_test'),
}

model UpdateLabelTableResponseBody = {
  requestId?: string(name='RequestId', example='728C5E01-ABF6-5AA8-B9FC-B3BA05DECC77'),
}

model UpdateLabelTableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateLabelTableResponseBody(name='body'),
}

/**
 * @summary 更新label表。
 *
 * @param request UpdateLabelTableRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateLabelTableResponse
 */
async function updateLabelTableWithOptions(InstanceId: string, LabelTableId: string, request: UpdateLabelTableRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateLabelTableResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.datasourceId)) {
    body['DatasourceId'] = request.datasourceId;
  }
  if (!Util.isUnset(request.fields)) {
    body['Fields'] = request.fields;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateLabelTable',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/labeltables/${OpenApiUtil.getEncodeParam(LabelTableId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新label表。
 *
 * @param request UpdateLabelTableRequest
 * @return UpdateLabelTableResponse
 */
async function updateLabelTable(InstanceId: string, LabelTableId: string, request: UpdateLabelTableRequest): UpdateLabelTableResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateLabelTableWithOptions(InstanceId, LabelTableId, request, headers, runtime);
}

model UpdateModelFeatureRequest {
  features?: [ 
    {
      aliasName?: string(name='AliasName', example='sex'),
      featureViewId?: string(name='FeatureViewId', description='This parameter is required.', example='5'),
      name?: string(name='Name', description='This parameter is required.', example='gender'),
      type?: string(name='Type', description='This parameter is required.', example='STRING'),
    }
  ](name='Features'),
  labelPriorityLevel?: long(name='LabelPriorityLevel', example='0'),
  labelTableId?: string(name='LabelTableId', example='4'),
  sequenceFeatureViewIds?: [ string ](name='SequenceFeatureViewIds'),
}

model UpdateModelFeatureResponseBody = {
  requestId?: string(name='RequestId', example='C33E160C-BFCA-5719-B958-942850E949F6'),
}

model UpdateModelFeatureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateModelFeatureResponseBody(name='body'),
}

/**
 * @summary 更新模型特征。
 *
 * @param request UpdateModelFeatureRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateModelFeatureResponse
 */
async function updateModelFeatureWithOptions(InstanceId: string, ModelFeatureId: string, request: UpdateModelFeatureRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateModelFeatureResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.features)) {
    body['Features'] = request.features;
  }
  if (!Util.isUnset(request.labelPriorityLevel)) {
    body['LabelPriorityLevel'] = request.labelPriorityLevel;
  }
  if (!Util.isUnset(request.labelTableId)) {
    body['LabelTableId'] = request.labelTableId;
  }
  if (!Util.isUnset(request.sequenceFeatureViewIds)) {
    body['SequenceFeatureViewIds'] = request.sequenceFeatureViewIds;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateModelFeature',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/modelfeatures/${OpenApiUtil.getEncodeParam(ModelFeatureId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新模型特征。
 *
 * @param request UpdateModelFeatureRequest
 * @return UpdateModelFeatureResponse
 */
async function updateModelFeature(InstanceId: string, ModelFeatureId: string, request: UpdateModelFeatureRequest): UpdateModelFeatureResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateModelFeatureWithOptions(InstanceId, ModelFeatureId, request, headers, runtime);
}

model UpdateModelFeatureFGFeatureRequest {
  lookupFeatures?: [ 
    {
      defaultValue?: string(name='DefaultValue', description='This parameter is required.', example='-1024'),
      featureName?: string(name='FeatureName', description='This parameter is required.', example='item_id'),
      keyFeatureDomain?: string(name='KeyFeatureDomain', description='This parameter is required.', example='Item'),
      keyFeatureName?: string(name='KeyFeatureName', description='This parameter is required.', example='1'),
      mapFeatureDomain?: string(name='MapFeatureDomain', description='This parameter is required.', example='User'),
      mapFeatureName?: string(name='MapFeatureName', description='This parameter is required.', example='item_id'),
      valueType?: string(name='ValueType', description='This parameter is required.', example='STRING'),
    }
  ](name='LookupFeatures'),
  rawFeatures?: [ 
    {
      defaultValue?: string(name='DefaultValue', description='This parameter is required.', example='-1024'),
      featureDomain?: string(name='FeatureDomain', description='This parameter is required.', example='User'),
      featureName?: string(name='FeatureName', description='This parameter is required.', example='item_id'),
      featureType?: string(name='FeatureType', description='This parameter is required.', example='IdFeature'),
      inputFeatureName?: string(name='InputFeatureName', description='This parameter is required.', example='item_id'),
      valueType?: string(name='ValueType', description='This parameter is required.', example='STRING'),
    }
  ](name='RawFeatures'),
  reserves?: [ string ](name='Reserves'),
  sequenceFeatures?: [ 
    {
      attributeDelim?: string(name='AttributeDelim', description='This parameter is required.', example='#'),
      featureName?: string(name='FeatureName', description='This parameter is required.', example='item_id'),
      sequenceDelim?: string(name='SequenceDelim', description='This parameter is required.', example=';'),
      sequenceLength?: long(name='SequenceLength', description='This parameter is required.', example='50'),
      subFeatures?: [ 
        {
          defaultValue?: string(name='DefaultValue', description='This parameter is required.', example='-1024'),
          featureDomain?: string(name='FeatureDomain', description='This parameter is required.', example='User'),
          featureName?: string(name='FeatureName', description='This parameter is required.', example='item_id'),
          featureType?: string(name='FeatureType', description='This parameter is required.', example='RawFeature'),
          inputFeatureName?: string(name='InputFeatureName', description='This parameter is required.', example='item_id'),
          valueType?: string(name='ValueType', description='This parameter is required.', example='STRING'),
        }
      ](name='SubFeatures'),
    }
  ](name='SequenceFeatures'),
}

model UpdateModelFeatureFGFeatureResponseBody = {
  requestId?: string(name='requestId', example='7D497816-607C-5B67-97B1-61354B6ACB2B'),
}

model UpdateModelFeatureFGFeatureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateModelFeatureFGFeatureResponseBody(name='body'),
}

/**
 * @summary 更新模型特征的FG特征配置信息。
 *
 * @param request UpdateModelFeatureFGFeatureRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateModelFeatureFGFeatureResponse
 */
async function updateModelFeatureFGFeatureWithOptions(InstanceId: string, ModelFeatureId: string, request: UpdateModelFeatureFGFeatureRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateModelFeatureFGFeatureResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.lookupFeatures)) {
    body['LookupFeatures'] = request.lookupFeatures;
  }
  if (!Util.isUnset(request.rawFeatures)) {
    body['RawFeatures'] = request.rawFeatures;
  }
  if (!Util.isUnset(request.reserves)) {
    body['Reserves'] = request.reserves;
  }
  if (!Util.isUnset(request.sequenceFeatures)) {
    body['SequenceFeatures'] = request.sequenceFeatures;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateModelFeatureFGFeature',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/modelfeatures/${OpenApiUtil.getEncodeParam(ModelFeatureId)}/fgfeature`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新模型特征的FG特征配置信息。
 *
 * @param request UpdateModelFeatureFGFeatureRequest
 * @return UpdateModelFeatureFGFeatureResponse
 */
async function updateModelFeatureFGFeature(InstanceId: string, ModelFeatureId: string, request: UpdateModelFeatureFGFeatureRequest): UpdateModelFeatureFGFeatureResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateModelFeatureFGFeatureWithOptions(InstanceId, ModelFeatureId, request, headers, runtime);
}

model UpdateProjectRequest {
  description?: string(name='Description', example='This is a test.'),
  name?: string(name='Name', example='project1'),
}

model UpdateProjectResponseBody = {
  requestId?: string(name='RequestId', example='2150233F-A1F7-54D2-B5B5-8A70567549BD'),
}

model UpdateProjectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateProjectResponseBody(name='body'),
}

/**
 * @summary 更新指定Feature Store项目信息。
 *
 * @param request UpdateProjectRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateProjectResponse
 */
async function updateProjectWithOptions(InstanceId: string, ProjectId: string, request: UpdateProjectRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProjectResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.description)) {
    body['Description'] = request.description;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateProject',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/projects/${OpenApiUtil.getEncodeParam(ProjectId)}`,
    method = 'PUT',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新指定Feature Store项目信息。
 *
 * @param request UpdateProjectRequest
 * @return UpdateProjectResponse
 */
async function updateProject(InstanceId: string, ProjectId: string, request: UpdateProjectRequest): UpdateProjectResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return updateProjectWithOptions(InstanceId, ProjectId, request, headers, runtime);
}

model WriteFeatureViewTableRequest {
  mode?: string(name='Mode', description='This parameter is required.', example='Merge'),
  partitions?: map[string]object(name='Partitions'),
  urlDatasource?: {
    delimiter?: string(name='Delimiter', example=','),
    omitHeader?: boolean(name='OmitHeader', example='true'),
    path?: string(name='Path', example='xxx.xxx.com/file.csv'),
  }(name='UrlDatasource'),
}

model WriteFeatureViewTableResponseBody = {
  requestId?: string(name='RequestId', example='0C89F5E1-7F24-5EEC-9F05-508A39278CC8'),
  taskId?: string(name='TaskId'),
}

model WriteFeatureViewTableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: WriteFeatureViewTableResponseBody(name='body'),
}

/**
 * @summary 获取特征视图血缘关系。
 *
 * @param request WriteFeatureViewTableRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return WriteFeatureViewTableResponse
 */
async function writeFeatureViewTableWithOptions(InstanceId: string, FeatureViewId: string, request: WriteFeatureViewTableRequest, headers: map[string]string, runtime: Util.RuntimeOptions): WriteFeatureViewTableResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.mode)) {
    body['Mode'] = request.mode;
  }
  if (!Util.isUnset(request.partitions)) {
    body['Partitions'] = request.partitions;
  }
  if (!Util.isUnset(request.urlDatasource)) {
    body['UrlDatasource'] = request.urlDatasource;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'WriteFeatureViewTable',
    version = '2023-06-21',
    protocol = 'HTTPS',
    pathname = `/api/v1/instances/${OpenApiUtil.getEncodeParam(InstanceId)}/featureviews/${OpenApiUtil.getEncodeParam(FeatureViewId)}/action/writetable`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  if (Util.isUnset(@signatureVersion) || !Util.equalString(@signatureVersion, 'v4')) {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取特征视图血缘关系。
 *
 * @param request WriteFeatureViewTableRequest
 * @return WriteFeatureViewTableResponse
 */
async function writeFeatureViewTable(InstanceId: string, FeatureViewId: string, request: WriteFeatureViewTableRequest): WriteFeatureViewTableResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return writeFeatureViewTableWithOptions(InstanceId, FeatureViewId, request, headers, runtime);
}

